﻿using System.Collections.Generic;
using StructureMap;

namespace BestEasyCMS.Framework.Domain.Events
{
    /// <summary>
    /// 实现领域事件处理程序工厂
    /// </summary>
    public class StructureMapDomainEventHandlerFactory : IDomainEventHandlerFactory
    {
        public IEnumerable<IDomainEventHandler<T>> GetDomainEventHandlersFor<T>(T domainEvent) where T : IDomainEvent
        {
            return ObjectFactory.GetAllInstances<IDomainEventHandler<T>>();
        }
    }

}
